<html><body>
<style>

body, h1, h2, h3, div, span, p, pre, a {
  margin: 0;
  padding: 0;
  border: 0;
  font-weight: inherit;
  font-style: inherit;
  font-size: 100%;
  font-family: inherit;
  vertical-align: baseline;
}

body {
  font-size: 13px;
  padding: 1em;
}

h1 {
  font-size: 26px;
  margin-bottom: 1em;
}

h2 {
  font-size: 24px;
  margin-bottom: 1em;
}

h3 {
  font-size: 20px;
  margin-bottom: 1em;
  margin-top: 1em;
}

pre, code {
  line-height: 1.5;
  font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}

pre {
  margin-top: 0.5em;
}

h1, h2, h3, p {
  font-family: Arial, sans serif;
}

h1, h2, h3 {
  border-bottom: solid #CCC 1px;
}

.toc_element {
  margin-top: 0.5em;
}

.firstline {
  margin-left: 2 em;
}

.method  {
  margin-top: 1em;
  border: solid 1px #CCC;
  padding: 1em;
  background: #EEE;
}

.details {
  font-weight: bold;
  font-size: 14px;
}

</style>

<h1><a href="analyticsreporting_v4.html">Analytics Reporting API</a> . <a href="analyticsreporting_v4.userActivity.html">userActivity</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
  <code><a href="#close">close()</a></code></p>
<p class="firstline">Close httplib2 connections.</p>
<p class="toc_element">
  <code><a href="#search">search(body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Returns User Activity data.</p>
<p class="toc_element">
  <code><a href="#search_next">search_next()</a></code></p>
<p class="firstline">Retrieves the next page of results.</p>
<h3>Method Details</h3>
<div class="method">
    <code class="details" id="close">close()</code>
  <pre>Close httplib2 connections.</pre>
</div>

<div class="method">
    <code class="details" id="search">search(body=None, x__xgafv=None)</code>
  <pre>Returns User Activity data.

Args:
  body: object, The request body.
    The object takes the form of:

{ # The request to fetch User Report from Reporting API `userActivity:get` call.
  &quot;activityTypes&quot;: [ # Set of all activity types being requested. Only acvities matching these types will be returned in the response. If empty, all activies will be returned.
    &quot;A String&quot;,
  ],
  &quot;dateRange&quot;: { # A contiguous set of days: startDate, startDate + 1 day, ..., endDate. The start and end dates are specified in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) date format `YYYY-MM-DD`. # Date range for which to retrieve the user activity. If a date range is not provided, the default date range is (startDate: current date - 7 days, endDate: current date - 1 day).
    &quot;endDate&quot;: &quot;A String&quot;, # The end date for the query in the format `YYYY-MM-DD`.
    &quot;startDate&quot;: &quot;A String&quot;, # The start date for the query in the format `YYYY-MM-DD`.
  },
  &quot;pageSize&quot;: 42, # Page size is for paging and specifies the maximum number of returned rows. Page size should be &gt; 0. If the value is 0 or if the field isn&#x27;t specified, the request returns the default of 1000 rows per page.
  &quot;pageToken&quot;: &quot;A String&quot;, # A continuation token to get the next page of the results. Adding this to the request will return the rows after the pageToken. The pageToken should be the value returned in the nextPageToken parameter in the response to the [SearchUserActivityRequest](#SearchUserActivityRequest) request.
  &quot;user&quot;: { # Contains information to identify a particular user uniquely. # Required. Unique user Id to query for. Every [SearchUserActivityRequest](#SearchUserActivityRequest) must contain this field.
    &quot;type&quot;: &quot;A String&quot;, # Type of the user in the request. The field `userId` is associated with this type.
    &quot;userId&quot;: &quot;A String&quot;, # Unique Id of the user for which the data is being requested.
  },
  &quot;viewId&quot;: &quot;A String&quot;, # Required. The Analytics [view ID](https://support.google.com/analytics/answer/1009618) from which to retrieve data. Every [SearchUserActivityRequest](#SearchUserActivityRequest) must contain the `viewId`.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # The response from `userActivity:get` call.
  &quot;nextPageToken&quot;: &quot;A String&quot;, # This token should be passed to [SearchUserActivityRequest](#SearchUserActivityRequest) to retrieve the next page.
  &quot;sampleRate&quot;: 3.14, # This field represents the [sampling rate](https://support.google.com/analytics/answer/2637192) for the given request and is a number between 0.0 to 1.0. See [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) for details.
  &quot;sessions&quot;: [ # Each record represents a session (device details, duration, etc).
    { # This represents a user session performed on a specific device at a certain time over a period of time.
      &quot;activities&quot;: [ # Represents a detailed view into each of the activity in this session.
        { # An Activity represents data for an activity of a user. Note that an Activity is different from a hit. A hit might result in multiple Activity&#x27;s. For example, if a hit includes a transaction and a goal completion, there will be two Activity protos for this hit, one for ECOMMERCE and one for GOAL. Conversely, multiple hits can also construct one Activity. In classic e-commerce, data for one transaction might be sent through multiple hits. These hits will be merged into one ECOMMERCE Activity.
          &quot;activityTime&quot;: &quot;A String&quot;, # Timestamp of the activity. If activities for a visit cross midnight and occur in two separate dates, then two sessions (one per date) share the session identifier. For example, say session ID 113472 has activity within 2019-08-20, and session ID 243742 has activity within 2019-08-25 and 2019-08-26. Session ID 113472 is one session, and session ID 243742 is two sessions.
          &quot;activityType&quot;: &quot;A String&quot;, # Type of this activity.
          &quot;appview&quot;: { # This will be set if `activity_type` equals `SCREEN_VIEW`.
            &quot;appName&quot;: &quot;A String&quot;, # The application name.
            &quot;mobileDeviceBranding&quot;: &quot;A String&quot;, # Mobile manufacturer or branded name. Eg: &quot;Google&quot;, &quot;Apple&quot; etc.
            &quot;mobileDeviceModel&quot;: &quot;A String&quot;, # Mobile device model. Eg: &quot;Pixel&quot;, &quot;iPhone&quot; etc.
            &quot;screenName&quot;: &quot;A String&quot;, # The name of the screen.
          },
          &quot;campaign&quot;: &quot;A String&quot;, # For manual campaign tracking, it is the value of the utm_campaign campaign tracking parameter. For AdWords autotagging, it is the name(s) of the online ad campaign(s) you use for the property. If you use neither, its value is (not set).
          &quot;channelGrouping&quot;: &quot;A String&quot;, # The Channel Group associated with an end user&#x27;s session for this View (defined by the View&#x27;s Channel Groupings).
          &quot;customDimension&quot;: [ # A list of all custom dimensions associated with this activity.
            { # Custom dimension.
              &quot;index&quot;: 42, # Slot number of custom dimension.
              &quot;value&quot;: &quot;A String&quot;, # Value of the custom dimension. Default value (i.e. empty string) indicates clearing sesion/visitor scope custom dimension value.
            },
          ],
          &quot;ecommerce&quot;: { # E-commerce details associated with the user activity. # This will be set if `activity_type` equals `ECOMMERCE`.
            &quot;actionType&quot;: &quot;A String&quot;, # Action associated with this e-commerce action.
            &quot;ecommerceType&quot;: &quot;A String&quot;, # The type of this e-commerce activity.
            &quot;products&quot;: [ # Details of the products in this transaction.
              { # Details of the products in an e-commerce transaction.
                &quot;itemRevenue&quot;: 3.14, # The total revenue from purchased product items.
                &quot;productName&quot;: &quot;A String&quot;, # The product name, supplied by the e-commerce tracking application, for the purchased items.
                &quot;productQuantity&quot;: &quot;A String&quot;, # Total number of this product units in the transaction.
                &quot;productSku&quot;: &quot;A String&quot;, # Unique code that represents the product.
              },
            ],
            &quot;transaction&quot;: { # Represents details collected when the visitor performs a transaction on the page. # Transaction details of this e-commerce action.
              &quot;transactionId&quot;: &quot;A String&quot;, # The transaction ID, supplied by the e-commerce tracking method, for the purchase in the shopping cart.
              &quot;transactionRevenue&quot;: 3.14, # The total sale revenue (excluding shipping and tax) of the transaction.
              &quot;transactionShipping&quot;: 3.14, # Total cost of shipping.
              &quot;transactionTax&quot;: 3.14, # Total tax for the transaction.
            },
          },
          &quot;event&quot;: { # Represents all the details pertaining to an event. # This field contains all the details pertaining to an event and will be set if `activity_type` equals `EVENT`.
            &quot;eventAction&quot;: &quot;A String&quot;, # Type of interaction with the object. Eg: &#x27;play&#x27;.
            &quot;eventCategory&quot;: &quot;A String&quot;, # The object on the page that was interacted with. Eg: &#x27;Video&#x27;.
            &quot;eventCount&quot;: &quot;A String&quot;, # Number of such events in this activity.
            &quot;eventLabel&quot;: &quot;A String&quot;, # Label attached with the event.
            &quot;eventValue&quot;: &quot;A String&quot;, # Numeric value associated with the event.
          },
          &quot;goals&quot;: { # Represents a set of goals that were reached in an activity. # This field contains a list of all the goals that were reached in this activity when `activity_type` equals `GOAL`.
            &quot;goals&quot;: [ # All the goals that were reached in the current activity.
              { # Represents all the details pertaining to a goal.
                &quot;goalCompletionLocation&quot;: &quot;A String&quot;, # URL of the page where this goal was completed.
                &quot;goalCompletions&quot;: &quot;A String&quot;, # Total number of goal completions in this activity.
                &quot;goalIndex&quot;: 42, # This identifies the goal as configured for the profile.
                &quot;goalName&quot;: &quot;A String&quot;, # Name of the goal.
                &quot;goalPreviousStep1&quot;: &quot;A String&quot;, # URL of the page one step prior to the goal completion.
                &quot;goalPreviousStep2&quot;: &quot;A String&quot;, # URL of the page two steps prior to the goal completion.
                &quot;goalPreviousStep3&quot;: &quot;A String&quot;, # URL of the page three steps prior to the goal completion.
                &quot;goalValue&quot;: 3.14, # Value in this goal.
              },
            ],
          },
          &quot;hostname&quot;: &quot;A String&quot;, # The hostname from which the tracking request was made.
          &quot;keyword&quot;: &quot;A String&quot;, # For manual campaign tracking, it is the value of the utm_term campaign tracking parameter. For AdWords traffic, it contains the best matching targeting criteria. For the display network, where multiple targeting criteria could have caused the ad to show up, it returns the best matching targeting criteria as selected by Ads. This could be display_keyword, site placement, boomuserlist, user_interest, age, or gender. Otherwise its value is (not set).
          &quot;landingPagePath&quot;: &quot;A String&quot;, # The first page in users&#x27; sessions, or the landing page.
          &quot;medium&quot;: &quot;A String&quot;, # The type of referrals. For manual campaign tracking, it is the value of the utm_medium campaign tracking parameter. For AdWords autotagging, it is cpc. If users came from a search engine detected by Google Analytics, it is organic. If the referrer is not a search engine, it is referral. If users came directly to the property and document.referrer is empty, its value is (none).
          &quot;pageview&quot;: { # Represents details collected when the visitor views a page. # This will be set if `activity_type` equals `PAGEVIEW`. This field contains all the details about the visitor and the page that was visited.
            &quot;pagePath&quot;: &quot;A String&quot;, # The URL of the page that the visitor viewed.
            &quot;pageTitle&quot;: &quot;A String&quot;, # The title of the page that the visitor viewed.
          },
          &quot;source&quot;: &quot;A String&quot;, # The source of referrals. For manual campaign tracking, it is the value of the utm_source campaign tracking parameter. For AdWords autotagging, it is google. If you use neither, it is the domain of the source (e.g., document.referrer) referring the users. It may also contain a port address. If users arrived without a referrer, its value is (direct).
        },
      ],
      &quot;dataSource&quot;: &quot;A String&quot;, # The data source of a hit. By default, hits sent from analytics.js are reported as &quot;web&quot; and hits sent from the mobile SDKs are reported as &quot;app&quot;. These values can be overridden in the Measurement Protocol.
      &quot;deviceCategory&quot;: &quot;A String&quot;, # The type of device used: &quot;mobile&quot;, &quot;tablet&quot; etc.
      &quot;platform&quot;: &quot;A String&quot;, # Platform on which the activity happened: &quot;android&quot;, &quot;ios&quot; etc.
      &quot;sessionDate&quot;: &quot;A String&quot;, # Date of this session in ISO-8601 format.
      &quot;sessionId&quot;: &quot;A String&quot;, # Unique ID of the session.
    },
  ],
  &quot;totalRows&quot;: 42, # Total rows returned by this query (across different pages).
}</pre>
</div>

<div class="method">
    <code class="details" id="search_next">search_next()</code>
  <pre>Retrieves the next page of results.

        Args:
          previous_request: The request for the previous page. (required)
          previous_response: The response from the request for the previous page. (required)

        Returns:
          A request object that you can call &#x27;execute()&#x27; on to request the next
          page. Returns None if there are no more items in the collection.
        </pre>
</div>

</body></html>